//
//  RemotePlayer.h
//  Player
//
//  Created by Burn on 2019/7/5.
//  Copyright © 2019 menksoft. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>
#import "Macro.h"


typedef NS_ENUM(NSUInteger, PlaySatu) {
    Unknown,
    Loading,
    ReadyToPlay,
    Failed,
    Play,
    PlayEnd,
    PayPaused
};


NS_ASSUME_NONNULL_BEGIN

@interface RemotePlayer : NSObject

@property(assign,nonatomic,getter=isPause) BOOL userPause;
@property(assign,nonatomic) CGFloat progress;
@property(strong,nonatomic) NSURL *url;
@property(copy,nonatomic)   NSString *assetKey;
@property(strong,nonatomic) AVPlayer *player;
@property(strong,nonatomic) AVPlayer *subPlayer;
@property(assign,nonatomic) CGFloat loadProgress;
@property(assign,nonatomic,getter=isMute) BOOL mute;    //  静音
@property(assign,nonatomic) CGFloat volume;             //  音量
@property(assign,nonatomic) CGFloat rate;               //  速率


@property(assign,nonatomic) NSInteger currentTime;
@property(assign,nonatomic) NSInteger totalTime;

@property(copy,nonatomic)NSString *currentTimeFormat;
@property(copy,nonatomic)NSString *totalTimeFormat;

@property(assign,nonatomic) PlaySatu playSatu;



- (void)playWith:(NSURL *)url cachePolicy:(BOOL)policy;
- (void)playWithProgress:(CGFloat)progress;
- (void)pause;
- (void)play;
- (void)stop;

- (void)userPause;



//IMSingletonH

@end

NS_ASSUME_NONNULL_END
